import uviewPlus from 'uview-plus'
import { createSSRApp } from 'vue'

import App from './App.vue'
import store from './store'
import { reqeust } from './config/request'

uni.$u.config.unit = 'rpx'
export function createApp() {
  const app = createSSRApp(App)
  app.use(uviewPlus)
  app.use(store)
  reqeust(store)
  return {
    app,
  }
}
// #ifndef MP
// 处理 wx.connectSocket promisify 兼容问题，强制返回 SocketTask
uni.connectSocket = (function(connectSocket) {
	console.log(connectSocket);
	return function(options) {
		console.log(options);
		options.success = options.success || function() {}
		return connectSocket.call(this, options)
	}
})(uni.connectSocket)
// #endif